<%-- 
    Document   : form terima barang
    Created on : Nov 21, 2013, 9:03:55 AM
    Author     : admin
--%>

<%@page import="java.util.logging.Logger"%>
<%@page import="java.util.logging.Level"%>
<%@page import="bean.Pemesanan"%>
<%@page import="bean.BarangGudang"%>
<%@page import="oracle.net.aso.C00"%>
<%@page import="bean.Penerimaan"%>
<%@page import="java.sql.SQLException"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="oracle.jdbc.pool.OracleDataSource"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body bgcolor="white">
        <%
            Penerimaan penerimaan = new Penerimaan();
            String kodePenerimaan = penerimaan.getKodePenerimaan();
        %>
        <form action="TerimaBarang">
              <table border="0" align="center">
            <th colspan="2"rowspan="1" width="1%" bgcolor="#1E1C1C" ><h1> <font color="white"
                        <h1 align="center" style="color:#00CCFF"> Rekayasa Perangkat Lunak Berorientasi Obyek </h1>
                        <h2 align="center" style="color:#00CCFF"> Sistem Informasi Distribusi Aqua " Toko Mentari " </h2>
                        <h3 align="center" style="color:#00CCFF"> Kelompok JBK+ </h3>
                    </font>

        </table>
            <font style="font-size: 18px ; font-family: 'Jokerman'"><center>FORM TERIMA BARANG</center></font><br>
            <table border="2" align="center" width="550" height="80">
        <tr>
            <td align="center">NO.</td>
            <td align="center">KODE PEMESANAN</td>
            <td align="center">WAKTU PEMESANAN</td>
            <td align="center">JUMLAH BARANG</td>
            <td align="center">USERNAME</td>
            <td align="center">PEMESAN</td>
            
            
        </tr>
            <br>
            
            <%
             Connection connection = null;
            OracleDataSource ds;
            try {
                ds = new OracleDataSource();
                ds.setURL("jdbc:oracle:thin:@172.23.9.185:1521:orcl");
                ds.setPassword("mhs115314034");
                ds.setUser("mhs115314034");
                connection = ds.getConnection();

                Statement statement = connection.createStatement();
                statement.executeQuery("select * from pemesanan");
//                System.out.println("data berhasil diinputkan");
            } catch (SQLException ex) {
                Logger.getLogger(Pemesanan.class.getName()).log(Level.SEVERE, null, ex);
            }
           
            Penerimaan terima = new Penerimaan();
            ResultSet resultSet = terima.tampilBarang();
            int counter = 1;
            while (resultSet.next()) {
                out.print("<tr>");
                out.print("<td align='center'>" + (counter) + "</td>");
                out.print("<td align='center'>" + resultSet.getString("kodepemesanan") + "</td>");
                out.print("<td align='center'>" + resultSet.getString("waktupemesanan") + "</td>");
                out.print("<td align='center'>" + resultSet.getString("jumlahbarang") + "</td>");
                out.print("<td align='center'>" + resultSet.getString("username") + "</td>");
                out.print("<td align='center'>" + resultSet.getString("pemesan") + "</td>");
               
                
                out.print("</tr>");
                counter++;
            }
        %> 
            <table border="0" align="center" width="220"> 
                <tr>
                    <td align="center">
                        <form action="TerimaBarang">
                            <input type="submit" value="SIMPAN" name="simpan" style="font-size: 12px"></form>
                       
                    </td>
                        
                </tr>
            </table>
        </form>
        <table border="0" align="center" width="220"> 
            <tr>
                <td align="center" width="50%"><form action="form_utama_gudang.jsp">
                        <input type="submit" value="KEMBALI" name="kembali" style="font-size: 12px"></form></td>
            </tr>
        </table>
    </body>
</html>